/*
 *--------------------------------------------------------------------------
 *   Battlefield - A Realtime Network Multiplayer Game
 *   =======================================================
 *   Developed by Group D02 - 2009/2010 Semester 4 - CS2103
 *     Harry Nguyen Duy Hoang <nnduyhoang@yahoo.co.uk>
 *     Kent Chng Siang Rong <fivefootway@gmail.com>
 *     Lim Yong Peng <limpeng1986@gmail.com>
 *     Loh Xiankun <u0807185@nus.edu.sg>
 *   Instructed by
 *     Dr. Damith C.Rajapakse <damith@gmail.com>
 *   =======================================================
 *   $Id: Battlefield.java 567 2010-07-25 20:55:57Z Harry $
 *   $LastChangedDate: 2010-07-25 20:55:57 +0000 (Sun, 25 Jul 2010) $
 *   $LastChangedBy: Harry $
 *--------------------------------------------------------------------------
 */
package battlefield;

import battlefield.entity.Session;
import battlefield.net.Network;
import battlefield.ui.GameUI;
import java.util.UUID;

/**
 *
 * @author Harry Nguyen
 */
public final class Battlefield {

    private static Battlefield instance;
    private GameUI gui;
    private Network network;
    private Session session;

    public static Battlefield getInstance() {
        return instance != null ? instance : (instance = new Battlefield());
    }

    public Battlefield() {
        gui = new GameUI();
        network = new Network();
        session = new Session(UUID.randomUUID());
    }

    public GameUI getGUI() {
        return gui;
    }

    public BattlefieldServerInterface getLogic() {
        return network.getClient() != null ? network.getClient().getBattlefieldServerImp() : null;
    }

    public Network getNetwork() {
        return network;
    }

    public Session getSession() {
        return session;
    }

    public static void main(String[] args) {
        Battlefield.getInstance();
    }
}
